package main

import (
	"fmt"
	"strconv"
)

func plusOne(digits []int) []int {
	n := 0
	for _, v := range digits {
		n = n*10 + v
	}
	fmt.Println(n)
	n++

	tmp := []int{}
	for _, v := range strconv.Itoa(n) {
		tv, _ := strconv.Atoi(string(v))
		tmp = append(tmp, tv)
	}

	return tmp
}

func main() {
	fmt.Println(plusOne([]int{1, 2, 3, 4}))
}
